package com.jtpay.payresulthelper.util;

import android.text.TextUtils;

import static com.jtpay.payresulthelper.util.PayContext.Debug;

/**
 * Description:
 * Date : 2018/06/14 10:17
 * Author : Joe
 */

public class ApiConstant {
    //    public static final String DEBUG_URL = "https://www.036buy.com/";//
    private static final String DEBUG_SERVER_ADDRESS_DEF = "http://test2wgzlw.jtpay.com/";//
    private static final String RELEASE_SERVER_ADDRESS_DEF = "http://zhizhuan.jtpay.com/";//
    private static String URL_IP = "";
    public static final long DEFAULT_LONG_CONNECT_TIMEOUT = 100L;
    // 5s
    public static final int DEFAULT_TIMEOUT_DEF = 5;
    public static int DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_DEF;
    public static final long DEFAULT_AUTHORIZE_DELAY_TASK = 40 * 60 * 1000L;


    public static final String HTTP_SUCCESS = "SUCCESS";

    public final static String REGISTER_API = "api/regist";
    public final static String NOTICES_API = "api/notices";
    public final static String PULSE_SPEED_API = "api/pulseSpeed";
    public final static String AUTHORIZE_API = "api/authorize";
    public final static String ACCOUNT_CHECK_API = "api/accountCheck";

    public static String getUrl() {
        if (Debug && TextUtils.isEmpty(URL_IP)) {
            URL_IP = DEBUG_SERVER_ADDRESS_DEF;
        } else if (TextUtils.isEmpty(URL_IP)) {
            URL_IP = RELEASE_SERVER_ADDRESS_DEF;
        }
        return URL_IP;
    }

}
